/*
 * @Author: Jiraiya
 * @Date: 2020-06-01 18:29:45
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-06-01 18:57:21
 * @Description: 
 */ 

 /**
  * @description: requestAnimationFrame
  * @param {type} 
  * @return: 
  */ 
 function move(el, max){
    let n = 0;id = null;
    function cb(){
        if(n > max){
            cancelAnimationFrame(id);
        }else{
            n++;
            el.style.left = `${n}px`;
            cancelAnimationFrame(id);
            id = requestAnimationFrame(cb);
        }
    }
    id = requestAnimationFrame(cb);
 }
 